<%@ page isELIgnored="false" language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<style type="text/css">
</style>
<script type="text/javascript">
	function addOrUpdateUser(){
		var r = $('#acaForm').form('validate');
		if(!r) {
			return false;
		}
		$.post("aca/acaReturnPopWindowAcaReturn",$("#acaForm").serializeArray(),function(data){
			$('#MyPopWindow').window('close');
			$('#acaTable').datagrid('reload');  
			$.messager.alert('提示',data.mes,'info');
		});
	}
	function noAca(){
		$('#retItem').html("消费记录不存在,请核实后在退货");
	}
	$.extend($.fn.validatebox.defaults.rules, {
	    ge: {
	        validator: function(value){
	        	if(value != parseFloat(value,10))
	        		return false;
	            return (value <= ${aca.consmoney});
	        },
	        message: '输入不是一个数字或退款金额大于交易金额!'
	    }
	});
</script>
	<div id="retItem">
 	<form id="acaForm" method="post" style="margin: 10;text-align: center;">
 	<input type="hidden" name="acaid" value="${aca.id }"/>
	<table >
		<tr>
			<td>卡号：</td>
			<td>${aca.abaid }</td>
		</tr>
		<tr>
			<td>消费金额：</td>
			<td>${aca.consmoney }</td>
		</tr>
		<tr>
			<td>手续费：</td>
			<td>${aca.fee }</td>
		</tr>
		<tr>
			<td>退货金额：</td>
			<td>
				<input type="text" name="returnMoney" class="easyui-validatebox" validType="ge" required="true"  value="${aca.consmoney }"/>
			</td>
		</tr>
		<tr>
			<td>退货原因：</td>
			<td>
				<textarea name="returnReason" class="easyui-validatebox"  required="true"></textarea>
			</td>
		</tr>
	</table>
	<a href="#" id="btn-back" onclick="closeWindow();" class="easyui-linkbutton" iconCls="icon-back">返回</a>
	<a href="#" id="btn-add" onclick="addOrUpdateUser();" class="easyui-linkbutton" iconCls="icon-save">保存</a>
	</div>
</form>
<script>
${aca == null ? "noAca();" : ""}
</script>